package com.lz.a;

import java.util.Scanner;

/**
 * @ClassName Demo9
 * @Description 接收用户输入的数据，判断是奇数还是偶数
 * @Author 2214361854
 * @Date 2022/5/26 22:35
 * @Version 1.0
 */
public class Demo9 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("输入整数：");
        int a = scanner.nextInt();
        oddAndEvenA(a);
        System.out.println("=========");
        oddAndEvenB(a);
    }

    private static void oddAndEvenA(int a) {
        if (a%2==0) {
            System.out.println(a+"偶数");
        }else {
            System.out.println(a+"奇数");
        }
    }

    private static void oddAndEvenB(int a) {
        System.out.println((a%2)==0?a+"偶数":a+"奇数");
    }
}
